﻿<%@ import namespace='DerptelligenceSite.Areas.Marein.Models.Blog' %>

<%@ Page Title="" Language="C#" MasterPageFile="Blog.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="html_title" runat="server">

	<%	String html_title = (String)ViewData["html_title"]; %>

	Marein - <%= html_title %>

</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="content" runat="server">

	<%	BlogTopic page_topic = (BlogTopic)ViewData["page_topic"];
		
		foreach ( BlogEntry entry in (IEnumerable < BlogEntry >)ViewData["entries"] )
		{

			BlogTopic topic = entry.topic;
			
			%>

			<div class="entry">

				<%= BlogLayout.OpenDiv( "entry_title", topic ) %>
					
					 <h2> <a href="<%= entry.url %>"> <%= entry.title %> </a> </h2>
					
				<%= BlogLayout.CloseDiv() %>
					 
				<div class="entry_info">
					
					<a href="<%= entry.url %>"><%= entry.comment_count %> comment<%= entry.comment_count == 1 ? "" : "s" %></a>. Tags: <%= entry.tags %>.
					<br />
					Published on <%= entry.prettydate %> as <a href="<%= topic.url %>"><%= topic.title %></a>.
					
				</div>
					
				<%= BlogLayout.OpenDoubleDiv( "entry_content", topic ) %>
						
						<%= entry.content %>
						
				<%= BlogLayout.CloseDoubleDiv() %>
				
			</div>

	<%	} %>

	<%
		if ( ViewData["comments"] != null )
		{	%>
			
			<div class="comments">

				<%= BlogLayout.OpenDiv( "comments_title", page_topic )%>
					
					<h3>Comments</h3>
					
				<%= BlogLayout.CloseDiv()%>

			<%	foreach ( BlogComment comment in (IEnumerable<BlogComment>)ViewData["comments"] )
				{
			
					%>

					<div class="comment">
						
						<%= BlogLayout.OpenDiv( "comment_title", page_topic )%>
						
							<div class="comment_author">
					
								<%= comment.author_name %>
					
							</div>
					
							<div class="comment_info">
					
								<%= comment.publishdate %>
					
							</div>

						<%= BlogLayout.CloseDiv()%>
					
						<%= BlogLayout.OpenDiv( "comment_content", page_topic )%>
						
								<%= comment.content %>
						
						<%= BlogLayout.CloseDiv()%>
				
					</div>

			<%	} %>

			</div>

	<%	}	%>

</asp:Content>